/*
 *
 * rem计算公式
 * version@2.0
 *
 */

(function (doc,win){
  let w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  let width;
  if(w > 1200){
    width=540;
  }else{
    width = w > 720 ? 720 : w;
  }
  let fz = width / 3.75;
  window.winFontSize=fz;
  document.getElementsByTagName("html")[0].style.cssText = 'font-size: ' + fz +"px";
  let realfz = ~~(+window.getComputedStyle(document.getElementsByTagName("html")[0]).fontSize.replace('px','')*10000)/10000
  if (fz !== realfz) {
    document.getElementsByTagName("html")[0].style.cssText = 'font-size: ' + fz * (fz / realfz) +"px";
  }
})(document, window);

